-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: add auth-test-server for OAuth conformance testing #1384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@modelcontextprotocol/client
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
- MCP server with Bearer token authentication - Uses SDK's requireBearerAuth middleware - Validates tokens via AS introspection endpoint (RFC 7662) - Serves Protected Resource Metadata at /.well-known/oauth-protected-resource - Designed for server auth conformance tests
- Add admin-action tool requiring 'admin' scope - Add scope-checking middleware for privileged tools - Returns 403 insufficient_scope for missing admin scope - Add scopes_supported to PRM response
7206ab4 to
e9377fb
Compare
Summary
Adds an auth-test-server to the conformance test suite for testing server-side OAuth implementation.
What's New
src/conformance/auth-test-server.ts- MCP server with OAuth authenticationsrc/conformance/README.mdwith documentationFeatures
requireBearerAuthmiddleware for authentication/.well-known/oauth-protected-resourceMCP_CONFORMANCE_AUTH_SERVER_URLenvironment variableUsage
# Start with a fake auth server MCP_CONFORMANCE_AUTH_SERVER_URL=http://localhost:3000 \ npx tsx src/conformance/auth-test-server.tsRelated
This server is used by the conformance repo's server auth tests (modelcontextprotocol/conformance#105).